"""
@Project ：Python_Learning 
@File    ：2.两数相加.py
@IDE     ：PyCharm 
@Author  ：zhupp
@Date    ：2024/10/21 23:14 
"""
from typing import Optional

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

class Solution:
    def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
        dummy_l1 = ListNode(0)
        dummy_l2 = ListNode(0)
        dummy_l1.next = l1
        dummy_l2.next = l2

        while dummy_l1.next and dummy_l2.next:





s = Solution()
a1 = ListNode(2)
b1 = ListNode(4)
c1 = ListNode(3)
a1.next = b1
b1.next = c1

a2 = ListNode(5)
b2 = ListNode(6)
c2 = ListNode(4)
a2.next = b2
b2.next = c2

print(s.addTwoNumbers(a1, a2).val)
print(s.addTwoNumbers(a1, a2).next.val)
print(s.addTwoNumbers(a1, a2).next.next.val)
